package com.tangye.massageshop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tangye.massageshop.entity.PackageEntity;
import com.tangye.massageshop.enums.PackageStatusEnum;
import com.tangye.massageshop.mapper.PackageMapper;
import com.tangye.massageshop.service.PackageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PackageServiceImpl implements PackageService {

    @Resource
    private PackageMapper packageMapper;
    @Override
    public List<PackageEntity> queryVarietyListPage(PackageEntity packageEntity) {
        return packageMapper.selectList(new QueryWrapper<>());
    }

    @Override
    public void add(PackageEntity packageEntity) {
        packageEntity.setPackageStatus(PackageStatusEnum.ONLINE.getCode());
        packageMapper.insert(packageEntity);
    }

    @Override
    public void update(PackageEntity packageEntity) {
        packageMapper.updateById(packageEntity);
    }
}
